package examples.codequality.infrastructure;

import examples.codequality.domain.User;
import examples.codequality.domain.UserGateway;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Component;

import java.util.UUID;

/**
 * @author baigod
 */
@Component
public class UserGatewayImpl implements UserGateway {

    @Resource
    UserMapper userMapper;

    @Override
    public User get(UUID id) {
        return userMapper.selectById(id);
    }

    @Override
    public void create(User user) {
        userMapper.create(user);
    }
}